package cate.common.table.activity.warorder.row;

import cate.common.table.ERow;
import cate.common.table.XSSFRowWrap;
import cate.common.table.d.GDWarOrder;
import easy.java.dev.note.NoteClass;
import easy.java.dev.note.NoteField;

@NoteClass("基础配置")
public class WarorderBaseRow extends ERow {

    @NoteField("配置ID")
    public int configTid;

    @NoteField("活动名称ID")
    public int nameId;

    @NoteField("基础充值项")
    public int basePayItemId;

    @NoteField("差额充值项")
    public int upGradePayItemId;

    @NoteField("进阶充值项")
    public int advancePayItemId;

    @NoteField("邮件ID")
    public int mailId;

    @NoteField("跑马灯ID")
    public int noticeId;

    @NoteField("经验道具ID")
    public int expItemId;

    @NoteField("战令币ID")
    public int tokenItemId;

    @NoteField("购买经验消耗")
    public String buyExpCostStr;

    @NoteField("购买经验增加")
    public int buyExp;

    @NoteField("附加宝箱奖励")
    public String exBoxRwdStr;

    @NoteField("附加宝箱经验")
    public int exBoxExpRequierd;

    @NoteField("等级分组")
    public int levelGroup;

    @NoteField("任务分组")
    public int taskGroup;

    @NoteField("商城分组")
    public int mallGroup;

    @NoteField("商城经验道具ID")
    public int mallExpItem;

    @Override
    public void parse(XSSFRowWrap xrw) {
        super.parse(xrw);
        this.id = xrw.getInteger("配置ID", 0);
        this.configTid = xrw.getInteger("配置ID", 0);
        this.nameId = xrw.getInteger("活动名称ID", 0);
        this.basePayItemId = xrw.getInteger("基础充值项",0);
        this.upGradePayItemId = xrw.getInteger("差额充值项",0);
        this.advancePayItemId = xrw.getInteger("进阶充值项",0);

        this.mailId = xrw.getInteger("邮件ID", 0);
        this.noticeId = xrw.getInteger("跑马灯ID", 0);

        this.expItemId = xrw.getInteger("经验道具ID",0);
        this.tokenItemId = xrw.getInteger("战令币ID", 0);

        this.buyExpCostStr = xrw.getString("购买经验消耗");
        this.buyExp = xrw.getInteger("购买经验增加", 0);

        this.exBoxRwdStr = xrw.getString("附加宝箱奖励");
        this.exBoxExpRequierd = xrw.getInteger("附加宝箱经验", 0);

        this.levelGroup = xrw.getInteger("等级分组",0);
        this.taskGroup = xrw.getInteger("任务分组", 0);
        this.mallGroup = xrw.getInteger("商城分组",0);

        this.mallExpItem = xrw.getInteger("商城经验道具ID",0);
    }


    public byte getPayItemType(int payItemId) {
        if (payItemId == basePayItemId) {
            return GDWarOrder.PayItemType.BASE;
        }
        if (payItemId == upGradePayItemId) {
            return GDWarOrder.PayItemType.UPGRADE;
        }
        if (payItemId == advancePayItemId) {
            return GDWarOrder.PayItemType.ADVANCE;
        }
        return GDWarOrder.PayItemType.NONE;
    }

}
